package day_2022_12_to_3.day;

/**
 * @author haomin
 * @date 2022/12/17 14:19
 **/
public class Day12_17_Num1764 {
    class Solution {
        public boolean canChoose(int[][] groups, int[] nums) {
            int n = nums.length,m = groups.length, i, j, k = 0;
            for(i = 0; i < m; ){
                int l = groups[i].length;
                if(k+l>n) return false;
                for(j = 0;j < l; j++) if(nums[k+j] != groups[i][j]) break;
                if(j == l) {i++; k+=l;}
                else k++;
            }
            return true;
        }
    }
}